<?php

namespace App\Entity\Sale;

use ApiPlatform\Core\Annotation\ApiResource;
use App\Base\Annotation\Common;
use App\Repository\Sale\SaleTuanRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;

/**
 * @ApiResource()
 * @ORM\Entity(repositoryClass=SaleTuanRepository::class)
 */
class SaleTuan
{
    /**
     * @Common(cnName="#",listType="text",editType="text")
     * @Groups({"sale","tuan"})
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @Common(cnName="团购名称",listType="text",editType="text")
     * @Groups({"sale","tuan"})
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $title;

    /**
     * @Common(cnName="开启时间",listType="text",editType="datetime")
     * @Groups({"sale","tuan"})
     * @ORM\Column(type="datetime")
     */
    private $startAt;

    /**
     * @Common(cnName="结束时间",listType="text",editType="datetime")
     * @Groups({"sale","tuan"})
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $endAt;

    /**
     * @Common(cnName="成团人数",listType="text",editType="text")
     * @Groups({"sale","tuan"})
     * @ORM\Column(type="integer", nullable=true)
     */
    private $numMin;

    /**
     * @Common(cnName="人员上限",listType="text",editType="text")
     * @Groups({"sale","tuan"})
     * @ORM\Column(type="integer", nullable=true)
     */
    private $numMax;

    /**
     * @Common(cnName="组队时限",listType="text",editType="text")
     * @Groups({"sale","tuan"})
     * @ORM\Column(type="float", nullable=true)
     */
    private $timeMin;

    /**
     * @Common(cnName="是否开启",listType="text",editType="switch")
     * @Groups({"sale","tuan"})
     * @ORM\Column(type="boolean")
     */
    private $status;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getTitle(): ?string
    {
        return $this->title;
    }

    public function setTitle(?string $title): self
    {
        $this->title = $title;

        return $this;
    }

    public function getStartAt(): ?\DateTimeInterface
    {
        return $this->startAt;
    }

    public function setStartAt(\DateTimeInterface $startAt): self
    {
        $this->startAt = $startAt;

        return $this;
    }

    public function getEndAt(): ?\DateTimeInterface
    {
        return $this->endAt;
    }

    public function setEndAt(?\DateTimeInterface $endAt): self
    {
        $this->endAt = $endAt;

        return $this;
    }

    public function getNumMin(): ?int
    {
        return $this->numMin;
    }

    public function setNumMin(?int $numMin): self
    {
        $this->numMin = $numMin;

        return $this;
    }

    public function getNumMax(): ?int
    {
        return $this->numMax;
    }

    public function setNumMax(?int $numMax): self
    {
        $this->numMax = $numMax;

        return $this;
    }

    public function getTimeMin(): ?float
    {
        return $this->timeMin;
    }

    public function setTimeMin(?float $timeMin): self
    {
        $this->timeMin = $timeMin;

        return $this;
    }

    public function getStatus(): ?bool
    {
        return $this->status;
    }

    public function setStatus(bool $status): self
    {
        $this->status = $status;

        return $this;
    }
}
